﻿'use strict';

angular.module('ishaCrmApp')
    .directive('autoFocus', ["$timeout", function ($timeout) {
        return {
            restrict: 'A',
            link: function (scope, element, attrs) {
                scope.$watch(attrs.autoFocus, function (value) {
                    if (value) {
                        $timeout(function () { element[0].focus(); });
                    }
                });
            }
        };
    }]);